<include file="Public::header" />
                            <div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>用户管理</h3>
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
					<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
						<table class="custom_table">
							<thead>
								<tr>
<!--								   <th><input class="check-all" type="checkbox" /></th>-->
								   <th width="40%">分类名</th>
								   <th>包含文章数</th>
                                   <th>单页</th>
                                   <th>导航显示</th>
                                   <th>排序</th>
                                   <th>操作</th>
								</tr>
							</thead>   
							<tbody>
                                <volist name="data" id="vo">
                                    <tr>
<!--                                        <td><input type="checkbox" name="mid[]" value="{vo.cid}"/></td>-->
                                        <td style="text-align:left;">{$vo.cname}</td>
                                        <td>{$vo.article_num}</td>
                                        <td><php>echo ($vo['single_page'] == 1) ? '<span class="c1">是</span>' : '否'</php></td>
                                        <td><php>echo ($vo['index_display'] == 1) ? '<span class="c1">是</span>' : '否'</php></td>
                                        <td><php>echo ($vo['index_display'] == 1) ? '<input style="width:50px;" key="'.$vo['cid'].'" type="text" name="order" value="'.$vo['order'].'" class="order"/>' : "&nbsp;"</php></td>
                                        <td>
                                            <!-- Icons -->
                                             <!--<a href="{:U('main/edit')}" title="Edit"><img src="__APP__/resources/image/console/icons/pencil.png" alt="Edit" /></a>-->
                                             <a href="{:U('main/cateEdit',array('cid'=>$vo['cid']))}" title="修改"><img src="__APP__/resources/image/console/icons/hammer_screwdriver.png" alt="Edit Meta" /></a>                                             
                                        </td>
                                    </tr>
                                </volist>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="6">
										<div class="bulk-actions align-left">
<!--											<select name="dropdown">
												<option value="option1">更新排序</option>
											</select>-->
											<a class="button" href="javascript:" id="order_button">更新排序</a>
										</div>
										<div class="clear"></div>
									</td>
                                <script type="text/javascript">
                                    $(function(){
                                       $('#order_button').click(function(){
                                            var order_json = '[';
                                            var key = 0;                             
                                            $('.order').each(function(){
                                                key = $(this).attr('key');
                                                val = $(this).val();
                                                if( key !== '' || key !== 0){
                                                    order_json +='{"'+key+'":"'+val+'"},';
                                                };
                                            });
                                            order_json = order_json.substr(0,order_json.length-1)+']';
                                            $.post("{:U('main/cateOrder')}", {order:order_json}, function(i){
                                                alert('更新成功');
                                                location.reload();
                                            }, 'json');
                                            var order_json = '[';
                                            var key = 0;                                             
                                        })
                                    })
                                    
                                </script>
								</tr>
							</tfoot>                            
						</table>
					</div> <!-- End #tab1 -->
				</div> <!-- End .content-box-content -->
			</div> <!-- End .content-box -->
<include file="Public::footer" />
